﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DailyMoonwf.aspx.cs" Inherits="Catering.Catering_Page.richang.DailyMoonwf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../Style/center.css" rel="stylesheet" type="text/css" />
    <link href="../../Style/sysData.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        var _rbmvalue = "是";
        var _isCommunicate = "否";
        $(document).ready(function () {
            $("#DishDate").focus(function () { WdatePicker({ dateFmt: 'yyyy-MM-dd' }) });
            $("#CheckDate").focus(function () { WdatePicker({ dateFmt: 'yyyy-MM-dd' }) });

            $("input[name='rbisCommunicate']").change(function () {
                _isCommunicate = $(this).val();
            });
            $("input[name='rbm']").change(function () {
                var _thisval = $(this).val();
                _rbmvalue = _thisval;
                rbm_change();
            });
            rbm_change();
        });

        
        function rbm_change()
        {
            if (_rbmvalue == "是") {
                $("#ddl_moon").show("normal");
                $("#table_wzcb").show("normal");
                $("#table_rcjk").show("normal");
                $("#table_cfzt").show("normal");

                $("#ddl_moon").empty();

                $("#ddl_moon").append($("<option value='-1'>请选择</option>"))
                $.ajax({
                    url: "DailyMoonwf.aspx/GetMoonForDropDownList",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        for (var i = 0; i < data.d.length; i++) {
                            var _itemMoon = data.d[i].split(",");
                            $("#ddl_moon").append($("<option value='" + _itemMoon[0] + "'>" + _itemMoon[1] + "</option>"));
                        }
                    }
                });
            } else if (_rbmvalue == "否") {
                $("#ddl_moon").hide("normal");
                $("#table_wzcb").hide("normal");
                $("#table_rcjk").hide("normal");
                $("#table_cfzt").hide("normal");
                $("#ddl_moon").empty();
            }
        }

        //显示添加
        function Get() {

        }

        //显示修改
        function Edit(cid) {

        }

        //添加数据
        function btn_Add() {
            if (_rbmvalue == "是") {
                var WoJu = $("#WoJu").val();
                var CanJu = $("#CanJu").val();
                var Rice = $("#Rice").val();
                var Surfice = $("#Surfice").val();
                var Oil = $("#Oil").val();
                var DishDate = $("#DishDate").val();
                var CheckDate = $("#CheckDate").val();
                var IsCommunicate = _isCommunicate;
                var Area = $("#Area").val();
                var Oilstove = $("#Oilstove").val();
                var SmokeMachineWash = $("#SmokeMachineWash").val();
                var FireExtinguisher = $("#FireExtinguisher").val();
                var FireBlanket = $("#FireBlanket").val();
                var HighRiskEqui = $("#HighRiskEqui").val();
                $.ajax({
                    type: "Post",
                    url: "DailyMoonwf.aspx/Add",
                    data: "{  '_WoJu' :'" + WoJu + "',  '_CanJu' :'" + CanJu + "' ,  '_Rice' :'" + Rice + "',  '_Surfice' :'" + Surfice + "' ,  '_Oil' :'" + Oil + "' ,  '_DishDate' :'" + DishDate + "' ,  '_CheckDate' : '" + CheckDate + "',  '_IsCommunicate' : '" + IsCommunicate + "',  '_Area' :'" + Area + "',  '_Oilstove' :'" + Oilstove + "' ,  '_SmokeMachineWash' : '" + SmokeMachineWash + "',  '_FireExtinguisher' :'" + FireExtinguisher + "',  '_FireBlanket' :'" + FireBlanket + "',  '_HighRiskEqui' :'" + HighRiskEqui + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d == "ok") {
                            alert("保存成功！");
                            window.location.href = 'DailyMoonwf.aspx';
                        }
                    }
                });
            }
            else if (_rbmvalue == "否") {

            }
        }

        //修改数据
        function btn_Edit() {

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="500" height="500">
                <tr>
                    <td colspan="2">卫星平台汇报：
                    <input type="radio" name="rbm" value="是" checked="checked" />是
	                <input type="radio" name="rbm" value="否" />否
	                <select id="ddl_moon">
                    </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="100%" id="table_wzcb">
                            <tr>
                                <td colspan="4">（*）1.物资储备</td>
                            </tr>
                            <tr>
                                <td align="right">卧具（套）：</td>
                                <td>
                                    <input id="WoJu" type="text" size="9" /></td>
                                <td align="center">餐具（套）：</td>
                                <td>
                                    <input id="CanJu" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">米（kg）：</td>
                                <td>
                                    <input id="Rice" type="text" size="9" /></td>
                                <td align="center">面（kg）：</td>
                                <td>
                                    <input id="Surfice" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">油（kg）：</td>
                                <td>
                                    <input id="Oil" type="text" size="9" /></td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="100%" id="table_rcjk">
                            <tr>
                                <td colspan="4">（*）2.日常监控</td>
                            </tr>
                            <tr>
                                <td align="right">上菜日期：</td>
                                <td>
                                    <input id="DishDate" type="text" size="9" /></td>
                                <td align="right">安全员巡检日期：</td>
                                <td>
                                    <input id="CheckDate" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">是否沟通：</td>
                                <td colspan="3">
                                    <input type="radio" name="rbisCommunicate" id="IsCommunicateT" value="是" />是
		                            <input type="radio" name="rbisCommunicate" id="IsCommunicateF" value="否" />否
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="100%" id="table_cfzt">
                            <tr>
                                <td colspan="4">（*）3.厨房状态：</td>
                            </tr>
                            <tr>
                                <td align="right">面积（m²）：</td>
                                <td>
                                    <input id="Area" type="text" size="9" /></td>
                                <td align="right">气/油灶：</td>
                                <td>
                                    <input id="Oilstove" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">烟机清洗：</td>
                                <td>
                                    <input id="SmokeMachineWash" type="text" size="9" /></td>
                                <td align="right">灭火器：</td>
                                <td>
                                    <input id="FireExtinguisher" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <p>灭火毯：</p>
                                </td>
                                <td>
                                    <input id="FireBlanket" type="text" size="9" /></td>
                                <td align="right">高危设备：</td>
                                <td>
                                    <input id="HighRiskEqui" type="text" size="9" /></td>
                            </tr>
                            <tr>
                                <td align="right">设备运转： </td>
                                <td colspan="3">
                                    <input type="radio" id="EquiOperationT" value="radiobutton" />正常
		                            <input type="radio" id="EquiOperationF" value="radiobutton" />异常
                                </td>
                            </tr>
                            <tr>
                                <td align="right"></td>
                                <td colspan="3">
                                    <input id="EquiOperation" type="text" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="button" id="btnDel" onclick="btn_Del()" class="input_btn_a" value="删除" /></td>
                    <td align="left">
                        <input type="button" id="btnAdd" onclick="btn_Add()" class="input_btn_a" value="提交" /></td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
